// pages/goods_x/goods_x.js
const app = getApp();

Page({

    /**
     * 页面的初始数据
     */
    data: {
        association_id: '',
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
        this.setData({
            association_id: options.association_id
        })
        this.getAssociationDetail();
    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function() {

    },

    //获取社团文化详情
    getAssociationDetail: function() {
        let _this = this,
        association_id = _this.data.association_id;
        app._get('/api/login/association/getAssociationDetail', {
            association_id: association_id
        }, function(response) {
            let setdata = {};
            setdata['association'] = response.data.data;
            _this.setData(setdata);
        })
    },


    //预览图片，放大预览
    preview(e) {
        wx.previewImage({
            current: e.target.dataset.imgurl, // 当前显示图片的http链接
            urls: [e.target.dataset.imgurl] // 需要预览的图片http链接列表
        })
    },

   
    //图片点击事件
    imgYu: function(event) {
        var that = this
        var img = event.currentTarget.dataset.src;
        var index = event.currentTarget.dataset.id;
        wx.previewImage({
            current: img[index],
            urls: [img]
        })
    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function() {
        return {
            title: "社团文化《" + this.data.course.name + "》推荐给您~",
        }
    },

})